package com.grape.action.base;

import java.util.ArrayList;
import java.util.List;

import org.apache.struts2.ServletActionContext;
import org.apache.struts2.convention.annotation.Action;
import org.apache.struts2.convention.annotation.Namespace;
import org.apache.struts2.convention.annotation.ParentPackage;
import org.apache.struts2.convention.annotation.Result;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Controller;

import com.grape.action.common.BaseAction;
import com.grape.domain.base.TakeTime;
import com.grape.service.base.TakeTimeService;

@Namespace("/takeTime")
@Controller
@Scope("prototype")
@ParentPackage("json-default")
public class TakeTimeAction extends BaseAction<TakeTime>{
	private static final long serialVersionUID = 1L;
	
	@Autowired
	private TakeTimeService tts;
	
	@Action(value="findAll",results=@Result(name="success",type="json"))
	public String findAll(){
		List<TakeTime> lt = tts.findAll();
		
		ServletActionContext.getContext().getValueStack().push(lt);
		return SUCCESS;
	};
	
}
